<template>
	<!-- 投诉 -->
	<view class="box">
		<view class="cardbox">
			<view class="title">
				投诉类型
			</view>
			<view class="card-item" v-for="(item,index) in list" :key="index" @click="go(item.id,item.title)">
				<text>{{item.title}}</text>
				<view class="u-iconfont uicon-arrow-right" style="color: #969799;font-size: 28rpx;"></view>
			</view>
			<view class="card-item" @click="nav()">
				<text>我的投诉&建议</text>
				<view class="u-iconfont uicon-arrow-right" style="color: #969799;font-size: 28rpx;"></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		mounted() {
			this.$http('user.Complaint').then(res => {
				console.log(res);
				if (res.code == 1) {
					this.list = res.data.list
				}
			})
		},
		methods:{
			go(id,title){
				uni.navigateTo({
					url:'/pages/user/complaintinfo?id='+id +'&title='+title
				})
			},
			nav(){
				uni.navigateTo({
					url:'/pages/user/mycomplaint'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.box {
		min-height: 100vh;
		background-color: #f4f6f4;
		padding-top: 30rpx;
		box-sizing: border-box;
	}

	.cardbox {
		margin: 0 auto;
		width: 700rpx;
		height: 978rpx;
		border-radius: 16rpx;
		opacity: 1;

		background: #FFFFFF;
		padding: 30rpx;
		box-sizing: border-box;

		.title {
			font-size: 38rpx;
			padding: 40rpx 0;
			box-sizing: border-box;
			border-bottom: 1rpx solid gainsboro;
			padding-left: 20rpx;
		}

		.card-item {
			// border-radius: 15rpx;
			padding: 40rpx 0;
			box-sizing: border-box;
			border-bottom: 1rpx solid gainsboro;
			padding-left: 20rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
		}

		.card-item:active {
			background-color: #ebebeb;
			border-radius: 15rpx;
		}
	}
</style>
